<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="_fragments :: head(~{::title})">
    <title>标签</title>
</head>
<body>
<!--导航条-->
<nav th:replace="_fragments :: menu(3)"></nav>
<!--中间内容-->
<div id="waypoint" class="m-container-large m-padded-tb-big animated bounceInUp">
    <div class="ui container">
        <!-- 头部   -->
        <div class="ui top attached m-bg segment">
            <div class="ui middle aligned two column  grid m-top-color">
                <div class="column">
                    <h3 class="ui header m-pink m-text-thin">标签</h3>
                </div>
                <div class="column right aligned">
                    共 <h3 class="ui header m-pink m-inline-block m-text-thin" th:text="${#arrays.length(tags)}">14</h3>个
                </div>
            </div>
        </div>
        <!--       标签         -->
        <div class="ui attached segment m-padded-tb-large m-bg">
            <div class="cloud m-bg" style="font-size:14px ">
                <ul>
                    <li>
                        <a th:href="@{/tags/{id}(id=${tag.id})}" th:each="tag : ${tags}"><span th:text="${tag.name}">SpringMVC</span>
                        <div class="m-inline-block" th:text="${#arrays.length(tag.blogs)}">3</div>
                        </a>
                    </li>
                </ul>
            </div>
        </div>
        <!--  内容区域      -->
        <div class="ui top attached padding segment m-top-color  m-bg">
            <div class="ui vertical padded segment m-padded-tb-large" th:each="blog : ${page.content}">
                <div class="ui middle aligned  grid stackable mobile reversed">
                    <div class="eleven wide column">
                        <h3 class="ui header m-black" ><a th:href="@{/blog/{id}(id=${blog.id})}" target="_blank" th:text="${blog.title}">RabbitMQ</a></h3>
                        <p class="m-text" th:text="${blog.description}+'...'">
                            RabbitMQ严格遵循AMQP协议(高级消息队列协议),帮助我们在进程之间传递异步消息（亦称面向消息的中间件）。RabbitMQ服务器是用Erlang语言编写的，而集群和故障转移是构建在开放电信平台框架上的。所有主要的编程语言均有与代理接口通讯的客户端库。</p>
                        <div class="ui stackable grid">
                            <div class="eleven wide column">
                                <div class="ui mini horizontal link list">
                                    <div class="item">
                                        <img th:src="@{${blog.user.avater}}"
                                             alt="" class="ui avatar image">
                                        <div class="content"><a href="#" style="color: #ffa2a2!important;"
                                                                class="header m-pink" th:text="${blog.user.nickname}">管理员</a></div>
                                    </div>
                                    <div class="item">
                                        <a href="#"><i class="calendar icon m-pink"></i><span th:text="${#dates.format(blog.updateTime,'yyyy-MM-dd')}">2020-12-09</span></a>
                                    </div>
                                    <div class="item">
                                        <a href="javascript:void(0);"><span th:text="${blog.views}">181</span><span
                                                class="m-pink"> ℃</span></a>
                                    </div>
                                </div>
                            </div>
                            <div class="right aligned five wide column">
                                <a th:href="@{/types/{id}(id=${blog.type.id})}" target="_blank"
                                   class="m-pink-label m-padding-tiny m-text-thin" th:text="${blog.type.name}">拓展</a>
                            </div>
                        </div>
                    </div>
                    <div class="ui five wide column">
                        <a th:href="@{/blog/{id}(id=${blog.id})}" target="_blank">
                            <img th:src="@{${blog.firstPicture}}"
                                 class="ui rounded image m-image" alt="">
                        </a>
                    </div>
                </div>
            </div>
        </div>
        <!--  分页      -->
        <div class="ui attached  segment m-bg">
            <center>
                <table class="m-mobile-wide" width="425px">
                    <tbody>
                    <tr align="center">
                        <td>
                            <a th:href="@{/(page=${page.number}-1)}" th:unless="${page.first}" class="ui button basic mini">上一页</a>
                        </td>
                        <td>
                            第
                            <h8 class="m-pink" th:text="${page.number+1}">2</h8>
                            页/共
                            <h8 class="m-pink" th:text="${page.totalPages}">4</h8>
                            页
                            &nbsp;
                            共
                            <h8 class="m-pink" th:text="${page.totalElements}" >29</h8>
                            篇
                        </td>
                        <td>
                            <form name="pageForm" th:action="@{/}" method="get">
                                <div class="ui mini input ">
                                    <input type="text" class="m-bg" name="page" placeholder="页码" style="width: 50px!important; height: 27.76px!important;">
                                    <button type="submit" style="font-size: 11px!important;width: 30px!important; height: 0px!important; border: none;margin: 5px;padding: 0;" class="m-pink m-bg">
                                        跳转
                                    </button>
                                </div>
                            </form>
                        </td>
                        <td> &nbsp;</td>
                        <td class="  " style="float: right">
                            <a  th:href="@{/(page=${page.number}+1)}" th:unless="${page.last}" class="ui button basic mini " style="float: right; ">下一页</a>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </center>
        </div>
    </div>
</div>
<!--页脚-->
<footer th:replace="_fragments :: footer"></footer>
<!--工具条-->
<div id="toolbar" class="m-bg animated fadeIn m-fixed m-right-bottom" style="display: none">
    <div class="ui vertical icon buttons">
        <div id="toTop-button" class="ui secondary m-bg-pink icon button"><i class="chevron up icon"></i></div>
    </div>
</div>
<!--/*/<th:block th:replace="_fragments :: script">/*/-->
<!--/*/</th:block>/*/-->
<!--适配移动端和电脑端-->
<!--樱花飘落-->
<script type="text/javascript">
    var browser = {
        versions: function () {
            var u = navigator.userAgent, app = navigator.appVersion;
            return {     //移动终端浏览器版本信息
                trident: u.indexOf('Trident') > -1, //IE内核
                presto: u.indexOf('Presto') > -1, //opera内核
                webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
                gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
                mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
                ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
                android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或uc浏览器
                iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器
                iPad: u.indexOf('iPad') > -1, //是否iPad
                webApp: u.indexOf('Safari') == -1 //是否web应用程序，没有头部与底部
            };
        }(),
        language: (navigator.browserLanguage || navigator.language).toLowerCase()
    }
    if (browser.versions.mobile) {
        //执行移动端的相关代码
        //alert("移动端");
        //设置移动端不显示网易云音乐插件
        /*      onload = function () {
                  var MusicDivShow = document.getElementById('netEasy-music');//获取指定div中的元素
                  MusicDivShow.style.display = 'none';//控制层隐藏
              };*/
    } else if (!browser.versions.mobile) { //非移动端，动态加载js和div
        //设置电脑端显示网易云音乐插件
        // onload = function () {
        //     var MusicDivShow = document.getElementById('netEasy-music');//获取指定div中的元素
        //     MusicDivShow.style.display = 'block';//控制层显示
        // };
        // var script1 = document.createElement('script');
        // script1.type = 'text/javascript';
        // script1.src = '\\js\\snow.js';

        // <!-- 天气预报 -->
        // WIDGET = {FID: 'EtgqPWMbdv'}
        // var script4 = document.createElement('script');
        // script4.type = 'text/javascript';
        // script4.src = 'https://apip.weatherdt.com/float/static/js/r.js?v=1111';

        var script2 = document.createElement('script');
        script2.type = 'text/javascript';
        // script2.src = 'https://cdn.jsdelivr.net/gh/yremp/yremp-js@1.5/sakura.js';
        script2.src = 'https://yremp.live/wp-content/uploads/resource/js/sakura.js';

        //画图
        // var script3 = document.createElement('script');
        // script3.type = 'text/javascript';
        // script3.color = '220,220,220';
        // script3.opacity = '0.7';//透明度
        // script3.zIndex = '-2';
        // script3.count = '200';
        // script3.src = '//cdn.bootcss.com/canvas-nest.js/1.0.0/canvas-nest.min.js';

        // $('body').append(script1);
        // $('body').append(script4);天气预报
        $('body').append(script2);
        // $('body').append(script3);划线背景
    }
</script>
</body>
</html>
<script>
    <!--  滚动侦测  -->
    var waypoint = new Waypoint({
        element: document.getElementById('waypoint'),
        handler: function(direction) {
            if(direction == 'down'){
                $("#toolbar").show(500);
            }else {
                $("#toolbar").hide(500);
            }
        }
    })
    <!-- 回到顶部   -->
    $("#toTop-button").click(function (){
        $(window).scrollTo(0,500)
    });
    <!-- 移动端导航条   -->
    $(".toggle.menu").click(function (){
        $(".m-item").toggleClass("m-mobile-hide")
    })
</script>